package cn.tedu.role.controller;

import cn.tedu.role.pojo.vo.RoleVO;
import cn.tedu.role.service.RoleService;
import cn.tedu.role.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1/role/api/")
@Slf4j
@Api(tags = "角色外部接口")
public class RoleApiController {
    @Autowired
    private RoleService roleService;

    @ApiOperation("外部获取列表")
    @GetMapping("getList")
    public JsonResult getList() {
        List<RoleVO> list = roleService.selectAll();
        return JsonResult.ok(list);
    }
}
